package model;

import java.util.Set;
import tools.Coord;


public class Zone {

    private final int num;

    private Set<SeaArea> nearbySeaAreas;
    private Set<Province> nearbyProvinces;
    private Coord coordinates;

    public Zone(int num) {
        this.num = num;
    }

    public Zone(int num, Coord coordinates) {
        this.num = num;
        this.coordinates = coordinates;
    }

    public Zone(int num, Set<SeaArea> nearbySeaAreas, Set<Province> nearbyProvinces) {
        this.num = num;
        this.nearbySeaAreas = nearbySeaAreas;
        this.nearbyProvinces = nearbyProvinces;
    }

    public boolean isAdjacent(Province p) {
        if(nearbyProvinces.contains(p))
        {
            return true;
        }
        else
        {
            return false;
        }
    }

    public boolean isAdjacent(SeaArea sa) {
        if(nearbySeaAreas.contains(sa))
        {
            return true;
        }
        else
        {
            return false;
        }
    }
    
    public boolean isAdjacent(Empire e) {
        if(nearbyProvinces.containsAll(e.getListProvinces()))
        {
            return true;
        }
        else
        {
            return false;
        }
    }

    /***************************** GETTERS & SETTERS **************************/

    public Set<SeaArea> getNearbySeaAreas () {
        return nearbySeaAreas;
    }

    public int getNum () {
        return num;
    }

    public Set<Province> getNearbyProvinces () {
        return nearbyProvinces;
    }

    public void setNearbyProvinces(Set<Province> nearbyProvinces) {
        this.nearbyProvinces = nearbyProvinces;
    }

    public void setNearbySeaAreas(Set<SeaArea> nearbySeaAreas) {
        this.nearbySeaAreas = nearbySeaAreas;
    }

    public Coord getCoordinates()
    {
        return coordinates;
    }

    

}

